import { createI18n } from 'vue-i18n'
import en from './en'
import zh from './zh'
import elementEnLocale from 'element-plus/lib/locale/lang/en'
import elementZhLocale from 'element-plus/lib/locale/lang/zh-cn'
const messages = {
	en: {
		...en,
		...elementEnLocale,
	},
	zh: {
		...zh,
		...elementZhLocale,
	},
}
const i18n = createI18n({
	legacy: false,
	globalInjection: true,
	locale: localStorage.getItem('lang') || 'zh',
	messages,
})

export default i18n